/* $VER: 1oo_WEEKTOP, v1.0 (10-oct-95) by Adolescent/1oo%
_____. __________. __________. __ _____
/ |_/ ___ |_/ ___ | \// /
| || \/ || \/ | / /
| || / || / | / /__
|____/~|__________/~|__________/~ \___/ \/ */
;options results;gu=getuser;se=sendstring;tr=transmit;signal on error;signal on ioerr;signal on syntax;logfile="sysdata:log/weektop.dat";topfile="sysdata:log/weekhig.dat";tab="|";blah="";upk=0;upf=0;gu 1;handle=result;gu 4;loc=result;gu 23;port=result;gu 40;acc=result;gu 41;id=result;gu 59;org=result;gu 1307358;lastco=upper(result);gu 1410926;byid=result;gu 1411054;byte=result;bbsidentify NAME;bbs=result;bbsidentify SYSOP;sys=result;MAIN:;if ~exists(logfile) then call MAKENEWLOG;if ~exists(topfile) then call MAKEHIGH;if arg(1)="M" then;do;call RESETLOG;Exit;End;if arg(1)='A' then call WEEKTOP;if arg(1)='' then call DISPLAYLOG;exit;RESETLOG:;tr "f1Reseting 1oo_WEEKTOP...";tr "n2Mailing sysop results...";setmailsubj "TOP UPLOADERS";tr "$0 C:copy "logfile" RAM:_Edbuff"Port"}";writemail 1;tr "n1Mailing 1-3 place uploaders...";call open(file,logfile,"R");num.1="st";num.2="nd";num.3="rd";do A=1 to 3;data=readln(file);parse var data "|" Acc.A "|" Handle.A "|" loc.A "|" UpK.A "|" UpF.A "|";call MAILUSER;end;call close(file);call open(high,topfile,"R");do z=1 to 2;top.z=readln(high);tr top.z;end;call close(high);if upk.1>top.2 then;do;top.2=upk.1;top.1=handle.1;blah=" cfYou have beaten the WEEKTOP high score. Keep up the good work...";end;call open(high,topfile,"W");call writeln(high,top.1);call writeln(high,top.2);call writeln(high,Handle.1);call writeln(high,upk.1);call close(high);tr "$0 C:delete "logfile" FORCE}";tr "$0 C:delete RAM:_Edbuff"Port" FORCE}";tr "n2Finished...n1";return;MAILUSER:;setmailsubj "WEEKLY TOP UPLOADER!";call open(mail,("RAM:_Edbuff"Port),'W');call writeln(mail,"z4cf");call writeln(mail," C O N G R A T U L A T I O N S z0");call writeln(mail,"cbn2 You were the "A||Num.A||" best uploader last week.");call writeln(mail,"c7n1"center("You uploaded cf"strip(UpK.A)"kc7 in a total of cf"strip(UpF.A)" files.",85));call writeln(mail,blah);call writeln(mail,"n1c6"center("Thank you for supporting "bbs" bbs.",78)"n2cf"center(SYS,78)"n1");call close(mail);writemail Acc.A;return;MAKEHIGH:;call open(high,topfile,"W");do a=1 to 2;call writeln(high,"Adolescent");call writeln(high,"1000");end;call close(high);return;DISPLAYLOG:;sendfile "SYSTEXT:sys.weektop";call open(file,logfile,"R");do A=1 to 10;data=readln(file);parse var data "|" Acc.A "|" Handle.A "|" loc.A "|" UpK.A "|" UpF.A "|";tr at(7+a,6)acc.a' 'handle.a||loc.A||upk.a||upf.a;end;call close(file);call open(high,topfile,"R");do a=1 to 4;lin.a=readln(high);end;tr at(19,12)left(lin.1,15)' ['right(strip(lin.2,"B"),8,'0')'k]'at(19,50)left(lin.3,15)' ['right(strip(lin.4,"B"),8,'0')'k]';tr;return;WEEKTOP:;if byid ~=id then call WHO;upk=0;upf=0;tab="|";if org>'' then loc=org;if ~exists(logfile) then call MAKENEWLOG;tr "n1z4c7 Updating Weekly Top Uploaders Log.... z0n1";call open(file,logfile,'R');do A=1 to 15;data=readln(File);parse var data "|" Acc.A "|" Handle.A "|" loc.A "|" UpK.A "|" UpF.A "|";if acc=acc.A then;Do;upk=upk.A;upf=upf.A;data=readln(File);parse var data "|" Acc.A "|" Handle.A "|" Loc.A "|" UpK.A "|" UpF.A "|";end;end;call close(file);upk=upk+(byte%1000);if byte>0 then upf=upf+1;se "L1411054 #0}";call open(file,logfile,'W');flag=0;do A=1 to 15;if flag=0&upk>upk.A then;do;flag=1;call writeln(file,tab||left(acc,4,)||tab||left(handle,20,)||tab||left(loc,30)||tab||left(upk,8)||tab||left(upf,8)||tab);end;call writeln(file,tab||left(acc.a,4,)||tab||left(handle.a,20,)||tab||left(loc.a,30)||tab||left(upk.a,8)||tab||left(upf.a,8)||tab);end;call close(file);return;MAKENEWLOG:;call open(file,logfile,'W');do a=1 to 15;call writeln(file,"|Acc |Handle |loc |0 |0 |");end;call close(file);return;WHO:;gu 1211102;acc=result;gu 1311212;handle=result;gu 1311330;org=result;loc="indy";return;AT:;return ''arg(1)';'arg(2)'H';ERROR:;IOERR:;SYNTAX:;tr 'n2c1WeekTop Has An Error in line: c3'sigl 'c1Code:c3' errortext(rc)